<?php
/**
 * php GEM Project
 * 
 * LICENSE
 * 
 * PHP System Architecture Enabling Rapid Application Deployment and Scalability
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * @copyright Copyright (C) 2010 Zeletron LLC (http://zeletron.com)
 * @license http://gem.zeletron.com/license
 */

/*
 * GEM/Service/Media.php
 * 
 * 
 * 
 * @author David Joly
 * @link http://zeletron.com
 * 
 * @category GEM
 * @package GEM_Service
 */
class GEM_Service_Media extends GEM_Service_Service
{
	/**
	 * Returns the Service Resource Id
	 * 
	 * @return string
	 */
	public function getResourceId()
	{
		return 'MediaService';
	}
	
	/**
	 * @param int $id | The image's file id
	 * @return GEM_Model_Domain_Image
	 */
	public function getImage($id)
	{
		return GEM_Model_Domain_Image::getFinder('Image')->find((int)$id);
	}
	
	/**
	 * @param mixed int | GEM_Model_Domain_User $user
	 * @param array $pagingOptions
	 * @return GEM_Model_Mapper_Collection
	 */
	public function getUserImages($user,array $pagingOptions = array())
	{
		return GEM_Model_Domain_Image::getFinder('Image')->findByOwner($user,$pagingOptions);
	}
}